<?php

require_once("conn.php");
$username = $_POST['username'];
$password = $_POST['password'];

if (isset($username)) {
    $username = trim($username);
}

if (isset($password)) {
    $password = trim($password);
}

$sql = "SELECT * FROM t_admin WHERE username = '" . $username . "' AND password = '" . $password . "'";
$db = new DBC();
$data = $db->fetchData($sql);
if (count($data) > 0) {
    $_SESSION['username'] = $username;
    echo "<script language='javascript'>location='fileList.php?menu=apk';</script>";
} else {
    echo "<script language='javascript'>alert('\u767b\u5f55\u5931\u8d25\uff0c\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef');</script>";
    echo "<script language='javascript'>location='login.php';</script>";
}
?>
